dojo.provide("lotex.lang.*");

/*
 * Adds the given properties/methods to the specified object
 */
lotex.lang._inhert = function(obj, props){
    var tobj = {};
    for(var x in props){
        // the "tobj" condition avoid copying properties in "props"
        // inherited from Object.prototype.  For example, if obj has a custom
        // toString() method, don't overwrite it with the toString() method
        // that props inherited from Object.protoype
        if(typeof tobj[x] == "undefined" || tobj[x] != props[x]) {
            if(dj_undef(x,obj)) obj[x] = props[x];
        }
    }
    // IE doesn't recognize custom toStrings in for..in
    if(dojo.render.html.ie && dojo.lang.isFunction(props["toString"]) && props["toString"] != obj["toString"]) {
        obj.toString = props.toString;
    }
    return obj;
}

/*
 * Adds the properties/methods of argument Objects to obj
 */
lotex.lang.inhert = function(obj, props /*, props, ..., props */){
    for(var i=1, l=arguments.length; i<l; i++){
        lotex.lang._inhert(obj, arguments[i]);
    }
    return obj;
}